home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / demobook / exbookglo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  5.7 KB  |  179 lines

  1. /*
  2.  * Copyright 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifdef DEBUG
  18. #include <malloc.h>
  19. #endif
  20. #define PGHEIGHT 10.0
  21. #define PGWIDTH 10.0
  22. /*
  23. #define PI 3.14159
  24. */
  25. #define PICBUFSIZ 60
  26. #define ICONLIMIT 20
  27. #define FRONT 1
  28. #define BACK 0
  29.  
  30. struct polylist{
  31.     int *ndcs;
  32.     int type;  /* TMP variable for debugging */
  33.     int poly;  /* the index into morecolors for the color of the polygon*/
  34.     int line;  /* the index into morecolors for the color of the line*/
  35.     };         /* if the index is less than 0, dont draw it */
  36.  
  37. struct iconstruct{   /* used to display icons/page of the currently opened */
  38.              /* book.  on a page, the list of icons per page, list */
  39.              /* of icons to display.                               */
  40.     long ok;        /* if all of the files are here show icon */
  41.     struct icntmpltstruct *iconptr;
  42.     struct iconstruct *nexticon;
  43.     short xposition_ndx;
  44.     short yposition_ndx;
  45.     int iconnum;
  46.     };
  47.  
  48. struct pagestruct{  /* holds all information per page of current opened book */
  49.     struct iconstruct *fronticons;
  50.     struct iconstruct *backicons;
  51.     struct markerstruct *markerptr;
  52.     struct pagestruct *prevpage;
  53.     struct pagestruct *nextpage;
  54.     int pgnum;
  55.     int direction;
  56.         int frontnumicons;
  57.         int backnumicons;
  58.     };
  59.  
  60. struct pagelist{
  61.     struct pagestruct *pageptr;
  62.     struct pagelist *next;
  63.         };
  64.  
  65. struct indexlist{ /* struct of a given element in the MASTER ICON LIST--see */
  66.                   /* icntmpltstruct--and MASTER KEYWORD LIST (see wordlist) */
  67.     struct pagelist *found_on_page;
  68.     struct grptmpltstruct *group;/*points to group if this is group name */
  69.     struct icntmpltstruct *icon;/* points to icon if this is icon name */
  70.         struct grpliststruct *grps; /* list of groups with this keyword */
  71.         struct iconstruct *icons; /* list of demos with this keyword */
  72.     struct indexlist *next;
  73.     short num;   /* used when writing file */
  74.     short count;  /* keesp track of the number of times this word is used */
  75.     char *string;
  76.         };
  77.  
  78. struct wordlist{
  79.     struct indexlist *indexptr;
  80.     struct wordlist *next;
  81.         };
  82.  
  83. struct filestruct{
  84.     long ok;        /* if all of the files are here show icon */
  85.         struct icntmpltstruct *icon;  /* points to the first icon that uses
  86.                                       this file, if the file gets re-used,
  87.                                       the poly pointer in the icon struct
  88.                                       also gets re-used.  */
  89.         struct filestruct *next;
  90.     int occurences;
  91.     short count;
  92.     Boolean written;
  93.         char *name;
  94.         };
  95.  
  96. struct filelist{
  97.     struct filestruct *file;
  98.     struct filelist *next;
  99.     };
  100.  
  101. struct icntmpltstruct{           /* struct contains all information about a */
  102.                         /* given icon/demo used by struct indexlist */
  103.     unsigned long *tex_image;
  104.     long tex_id;
  105.     long tex_width, tex_height;
  106.     long ok;        /* if all of the files are here show icon */
  107.     struct polylist *poly;
  108.     struct wordlist *keywords;
  109.     struct indexlist *nameptr;
  110.     struct indexlist *infoptr;
  111.     struct filestruct *geofile;
  112.     struct filestruct *imgfile;
  113.     struct filestruct *helpfile;
  114.     struct filelist *addtlfiles;
  115.     struct icntmpltstruct *nexticntmplt;
  116.         struct grpliststruct *grps;
  117.     float xsize;
  118.     float bbox[4][3];
  119.     short numkey;
  120.     int numpoly;
  121.     int occurences;
  122.     int iconnum;
  123.     char *startstring;
  124.     char *alt_command;
  125.     char filetype;
  126.     };
  127.  
  128. struct grptmpltstruct{     /* struct contains all information about a given */
  129.                            /* book.  remember "group/grp" == book in all this*/
  130.         long ok;  
  131.     struct indexlist *nameptr;
  132.     struct wordlist *keywords;
  133.     struct pagestruct *firstpage;
  134.     struct pagestruct *lastpage;
  135.     struct grptmpltstruct *nextgrp;
  136.     struct grptmpltstruct *prevgrp;
  137.     struct filestruct *helpfile;
  138.     float covercolor[3];  /* red, blue, green 0 to 1.0 */
  139.     short arttype;
  140.     short numpages;
  141.     short numkey;
  142.     };
  143.  
  144. struct grpliststruct{
  145.     struct grptmpltstruct *grpptr;
  146.     struct grpliststruct *next;
  147.     struct grpliststruct *prev;
  148.     float x;
  149.     float y;
  150.     };
  151.  
  152. typedef float MyPoint[3];
  153. extern MyPoint *icon_verts;
  154.  
  155. extern int lastvertex;
  156.  
  157.  
  158.  
  159. extern struct indexlist *Index;        /* ptr to head of MASTER KEYWORD LIST */
  160. extern struct icntmpltstruct *firsticon;  /* ptr to head of MASTER ICON LIST */
  161. extern struct icntmpltstruct *lasticon;
  162. extern struct icntmpltstruct *curicon;
  163. extern struct grptmpltstruct *firstgroup; /* ptr to head of MASTER BOOK LIST */
  164. extern struct grptmpltstruct *lastgroup;  /* NOTE:  "group" ==/means book    */
  165. extern struct pagestruct *selectedpage;
  166. extern struct pagestruct *leftpage;       /* global ptrs to left and right   */
  167. extern struct pagestruct *rightpage;      /* pages of currently opened book  */
  168. extern struct pagestruct *middlepage;
  169. extern struct pagestruct *curnewpage;
  170. extern struct grptmpltstruct *curgroup;   /* points to currently opened book */
  171. extern struct grptmpltstruct *newgrpptr;
  172. extern struct filestruct *headfile;     /* actual files associated w/ea demo */
  173. /*
  174. extern struct iconstruct *iconlist;
  175. */
  176. extern struct iconstruct *newgroupiconlist, *newgrouplasticon;
  177. extern struct iconstruct *seliconptr;
  178. extern struct pagestruct *prevpage;  /* used to unselect the prev selected icon */
  179.